<?php 

$hasSidebar = "";
$sidebar =    get_post_meta($post->ID,'_sidebar',true);
$sidebar = (trim($sidebar)=="") ? "full" : $sidebar; // ~~ For pages existing prior to theme activation should have full width by default ~   

if($sidebar!="full") :
	
	$hasSidebar = ($sidebar == "right-sidebar") ?	"hasRightSidebar" : "hasLeftSidebar";
	$layout = 'two-third-width'; 
else :
	$layout = 'full-width';
endif;

    
get_header(); 
$image_flag = false;
	?>   



<div class="skeleton clearfix page blog <?php echo $hasSidebar; ?>">
      
      <div class="content clearfix">
                 
            <div class="<?php if($sidebar!="full") echo "two-third-width"; else echo "full-width"; ?>">
             
              <?php 	wp_reset_query(); if(have_posts()): while(have_posts()) : the_post(); ?>
              <h1 class="custom-font heading"><?php the_title(); ?></h1>
              
              
                  <?php 
		 
		  if(trim($vthumb)=="Yes") :
			
						$video_type =  trim(get_post_meta($post->ID,"video_type",true));
						$video_link =  trim(get_post_meta($post->ID,"video_code",true));
			  
			  
						$code = '';
						switch($video_type){
							  
							  case "Dedicated" : $code = do_shortcode("[video src='{$video_link}' height={$height} width={$width} title='' ]");  break;
							  case "Youtube" : 
							  $video_link = explode("v=", $video_link);
							  $code = do_shortcode("[youtube id='{$video_link[1]}' height='{$height}' width='{$width}' title='' ]");  break;
							  case "Vimeo" :  
							  $video_link = explode("/", $video_link);
							  $code = do_shortcode("[vimeo id='".$video_link[count($video_link)-1]."' height='{$height}' width='{$width}' title='' ]");  break;
							  
							  
							  }
						echo "<div class='imageholder single-image'> $code </div>";		
						
						elseif (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())   ) :
                       
							 $id = get_post_thumbnail_id();
							 $ar = wp_get_attachment_image_src( $id, array(9999,9999) );
							 $theImageSrc = $helper->getMUFix($ar[0]);
                             $code = $helper->imageDisplay($theImageSrc , $height , $width , true , $ar[0] , false, false,'' ,'' ,false);  
						
						echo "<div class='imageholder single-image'> $code </div>";		
						
						endif; ?>
                        
                        
                         <div class="single-content"> <?php the_content(); ?> </div> <!-- main content  -->
            
               <?php endwhile; endif; ?>
                
                                     
            </div>  
            
               <?php  
	  wp_reset_query();
	  if($sidebar!="full") 
	  get_sidebar();  
	 ?>   
                 
      </div>
                  
    
</div> 
    
<?php get_footer(); ?>
      